package net.khoroshev.wschat.service.auth;

import net.khoroshev.wschat.model.entity.UserAuthority;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.util.Assert;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * User: vfirstov
 * Date: 18.11.13
 * Time: 21:38
 *
 */
public final class Authorities {

    public final static String ROLE_USER = "USER";
    public final static String ROLE_ADMIN = "ADMIN";
    public final static String ROLE_EMPTY = "";

    public final static Collection<UserAuthority> USER_AUTHORITIES = new ArrayList<UserAuthority>();
    public static final List<UserAuthority> NO_AUTHORITIES = Collections.emptyList();

    public final static UserAuthority USER_AUTHORITY = new UserAuthority(ROLE_USER);
    public final static UserAuthority ADMIN_AUTHORITY = new UserAuthority(ROLE_ADMIN);

    static {
        USER_AUTHORITIES.add(USER_AUTHORITY);
    }


}
